package com.briup.day17;

import jdk.internal.util.xml.impl.Input;

import java.io.*;

/**
 * 字节缓存输入流 字节缓存输出流 1对包装（增强）流
 * 提高了快速读取文件的操作
 * @author lining
 * @date 2024/1/29 14:32
 */
public class TestBufferdInputAndOutput {
    public static void main(String[] args) throws Exception{
        //1.创建流
        BufferedInputStream bis = null;//包装流对象
        BufferedOutputStream bos = null;//包装流对象
        InputStream in = null;//节点流对象
        OutputStream out = null;//节点流对象
        //2.创建包装流对象
        in = new FileInputStream("a.txt");
        out = new FileOutputStream("c.txt");
        bis = new BufferedInputStream(in);
        bos = new BufferedOutputStream(out);
        //3.读和写
        //刷新流。关闭流(从内层向外侧关闭)
        bos.flush();
        in.close();
        out.close();
        bis.close();
        bos.close();

    }
}
